﻿@model FlyingCircusWebIS.ViewModels.CupomVM.CupomFormVM

@{
    if (Model.Edicao)
    {
        ViewBag.Title = "Edição de registro";
        <h2>Edição</h2>
    }
    else
    {
        ViewBag.Title = "Novo registro";
        <h2>Novo</h2>
    }
}

<hr />

@using (Html.BeginForm("Form", "Cupom", FormMethod.Post))
{
    @Html.ValidationSummary()

    @Html.HiddenFor(model => model.Edicao)

    @Html.LabelFor(model => model.NomeCupom)
    @Html.TextBoxFor(model => model.NomeCupom)

    @Html.LabelFor(model => model.Descricao)
    @Html.TextAreaFor(model => model.Descricao)

    @Html.LabelFor(model => model.Desconto)
    @Html.TextBoxFor(model => model.Desconto)
      
    @Html.LabelFor(model => model.FlagAtivo)
    @Html.CheckBoxFor(model => model.FlagAtivo)

    @Html.LabelFor(model => model.CodCupom)
    if (Model.Edicao)
    {
        @Html.TextBoxFor(model => model.CodCupom, new { @readonly = "readonly" })
    }
    else
    {
        @Html.TextBoxFor(model => model.CodCupom)
    }
        

    
    

    <p>
        <input type="submit" value="Salvar" />
    </p>
}

<div>
    @Html.ActionLink("Voltar", "Index")
</div>
